package com.example.springevent.event.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.example.springevent.event.bo.IvdAddedEventBO;
import com.example.springevent.event.event.IvdAddedEvent;
import com.example.springevent.ivd.domain.InvoiceKey;

@Order(value = 3)
@Component
public class IvdAddedEventInvoiceListener implements ApplicationListener<IvdAddedEvent> {

	private static final Logger log = LoggerFactory.getLogger(IvdAddedEventInvoiceListener.class);

	@Override
	public void onApplicationEvent(IvdAddedEvent event) {
		log.info("事件监听IvdAddedEventInvoiceListener.onApplicationEvent。Thread={}, order=3:", Thread.currentThread().getName());
		IvdAddedEventBO ivd = event.getIvdAddedEventBO();
		log.info("发票[{}]增加核销金额[{}]", new InvoiceKey(ivd.getInvoiceCode(), ivd.getInvoiceNo()), ivd.getVerifyAmt());
	}

}
